//
//  Function.h
//  PinkOK
//
//  Created by BenyLiang on 13-8-7.
//  Copyright (c) 2013年 PinkOK. All rights reserved.
//

#import <UIKit/UIKit.h>

@class AVAssetExportSession;

@interface IMFunction : NSObject

//获取设备高度
+ (CGFloat)getDeviceWidth;

//MD5加密
+ (NSString *)md5:(NSString *)string;

//统计中英文混合的字符串长度
+ (int)lengthOfString:(NSString *)strtemp;

//获取label中文字的高度
+ (CGFloat)getLabelHeightWithText:(NSString *)text andFont:(UIFont *)font andLabelWidth:(CGFloat)width;
+ (CGFloat)getLabelHeightWithText:(NSString *)text font:(UIFont *)font lineSpacing:(CGFloat)spacing andLabelWidth:(CGFloat)width;

//获取当前IP地址
+ (NSString *)getIPAddress;

//旋转图片动画
+ (UIImageView *)rotate360DegreeWithImageView:(UIImageView *)imageView;

+ (NSString *)toHex:(u_int64_t)tmpid;

+ (NSString *)decodeHTMLString:(NSString *)string;

+ (uint8_t)adpcmEncode:(int32_t)sample reset:(int)reset;

+ (NSData *)adpcmEncodeData:(NSData *)data;

/**
*  比较两个版本号的大小
*
*  @param tVersion
*  @param aVertion
*
*  @return tVertion >= aVersion 返回YES
*/
+ (BOOL)isTheVersion:(NSString *)tVersion newerThanAnotherVersion:(NSString *)aVersion;

/**
 *  比较两个版本号的大小
 *
 *  @param localVersion 本地版本
 *  @param serverVersion 服务器版本
 *
 *  @return mt bt mt-bt
 */

+ (NSString *)returnUploadWith:(NSString *)localVersion ServerVersion:(NSString *)serverVersion;

//字符串转16进制
+ (NSData *)hexDataFromString:(NSString *)string;

// 获取设备UUID
+ (NSString *)getDeviceUUID;

// data 转十六进制字符串
+ (NSString*)dataChangeToString:(NSData*)data;
// 新协议
+ (NSData *)convertHexStrToData:(NSString *)str;
+ (NSString *)convertDataToHexStr:(NSData *)data;
+ (NSString *)ToHex:(long long int)tmpid;
+ (NSData *)strToAscll:(NSString *)str;
+ (int32_t)change:(int32_t)value;

+ (NSData *)AES128EncryptECB:(NSData *)plainText;
+ (NSData *)AES128DecryptECB:(NSData *)encryptText;

+ (NSDictionary *)returnCarDevices:(NSString *)carType;
//获取当前时间戳字符串
+ (NSString *)getTimestampSince1970;

@end
